<?php
    include "header.html";
?>
<!--breadcrumb S-->
<div class="mid">
  <h2 class="f12">
    <a href="/index.php?groupid=<?php echo $groupid; ?>"><b class="ico-bc"></b>我的网盘</a>
    <span class="ico-nav"></span>
    <?php
        if (count($namepaths) > 1)
        {
            $tmppath = "0";
            $tmpnamepath = "";
            for($idx = 1; $idx < count($namepaths); $idx ++)
            {
                $tmpnamepath = $tmpnamepath."/".$namepaths[$idx];
    ?>
    <a href="/index.php?dirid=<?php echo $paths[$idx]; ?>&path=<?php echo $tmppath; ?>&namepath=<?php echo $tmpnamepath; ?>"><?php echo $namepaths[$idx]; ?></a>
    <span class="ico-nav"></span>
    <?php
                $tmppath = $tmppath.".".$paths[$idx];
            }
        }
    ?>
  </h2>
</div>
<!--breadcrumb E--> 
<div id="container" class="container" onselectstart="return false;"> 
  <!--toolbar S-->
  <div class="toolbar mid" id="kuaipantoolbar">
     <div class="clearfix">
        <div class="l">
<a class="btn-127 btn-upload-127 ti l mr10" href="javascript:;" id="uploadbnt">上传文件</a>
<a class="btn-127 btn-newdir-127 ti l mr10" href="javascript:;" id="newdirbnt">新建文件夹</a> 

<?php
    if ($showdel == 1)
    {
        echo "<a class=\"btn-127 btn-delete-hide ti l mr10\" href=\"/index.php?groupid=$groupid&dirid=$dirid&path=$currentpath&namepath=$namepath&showdel=0\">隐藏删除文件</a>";
    }
    else
    {
        echo "<a class=\"btn-127 btn-delete-show ti l mr10\" href=\"/index.php?groupid=$groupid&dirid=$dirid&path=$currentpath&namepath=$namepath&showdel=1\">显示删除文件</a>";
    }
?>
<!--<a class="btn-127 btn-share-127 ti l mr10" href="javascript:;" id="newdirbnt">分享文件</a> -->
<div id="top_search" class="search cf r">
    <input id="search_key" name="key" type="text" autocomplete="off" value="文件搜索..." onfocus="if (this.value == '文件搜索...') this.value=''" style="outline-width: 0px; outline-style: none; outline-color: initial; ">
    <input id="search_submit" type="submit" value="搜索">
</div>
<div id="showuploadpress" class="upload-rate l white dn">上传文件到Draco网盘</div>
</div>

        <div class="r"> <!--<a class="btn-127 btn-download-kp  dib " href="#">下载Draco网盘</a> --></div>
      </div>
   </div>
   
   <?php
       if ($dirid != 0)
       {
   ?>
<div class="mid backup">
<a href="/index.php?dirid=<?php echo $upper; ?>&path=<?php echo $upperpath ?>&namepath=<?php echo $uppernamepath ?>&showdel=<?php echo $showdel; ?>&groupid=<?php echo $groupid ?>" class="blue"><b class="ico ico-backup"></b>返回上一级</a>
</div>
  <?php
      }
  ?>
  <!--toolbar E-->
  <div class="wrapper mid" id="datawrap">
      <!--主体 S-->
      <div class="main"> 
        <!--filelist S-->
        <div class="datatable ui-selectable">
          <table>
            <thead>
              <tr id="headertr">
                <th width="30" class="tc"><input type="checkbox" id="filtercheck" name="checkall"></th>
                <th><a class="db" href="#">文件名</a></th>
                <th width="48"><a class="db" href="#">大小</a></th>
                <th width="48"><a class="db" href="#">版本</a></th>
                <th width="140"><a class="db" href="#">日期</a></th>
              </tr>
            </thead>
            <tbody id="filelistwrap">
            
            <?php 
                if ($totalcount !== 0)
                {
            ?>
            <?php
                foreach($data['array'] as $row)
                {
                    $row = get_object_vars($row);
                    if (!$showdel && $row['isdeleted'])
                    {
                        continue;
                    }
                    if ($row['type'] !== 'DIR')
                    {
            ?>
              <tr id="tr37198419692879875" fileid="<?php echo $row["name"]; ?>" filever="1" iscanconvert="1" <?php if ($row['isdeleted']) echo "isdel=\"1\" "; ?> iscanwow="" isimage="" fileext="html" filename="<?php echo $row["name"]; ?>" filetype="file" class="">
                <td class="tc list-chk"><input type="checkbox" filetype="file" value="37198419692879875"></td>
                <td class="f14 "><?php if ($row['isdeleted']) echo "<del class=\"rel gray-2\">"; ?>
                <b class="ico ico-doc mt10 l"></b><!--ico-share-in = 我收到共享文件  ico-share-out =我共享出去的文件  ico-outlink-ready=已经发布外链的文件 -->
                <?php
                    if ($isversion !== 1)
                    {
                ?>
                <a href="/fileversion.php?ownerid=<?php echo $ownerid; ?>&parentid=<?php echo $dirid; ?>&name=<?php echo $row['name']; ?>" title="<?php echo $row["name"]; ?>" onselectstart="return false;" fileid="37198419692879875" defaultop="Browse"><?php echo $row["name"]; ?></a>
                <?php 
                    } else {
                ?>
                 <a href="/<?php echo $ownerid; ?>/<?php echo $dirid; ?>/download_file/<?php echo $row['name'].'&version='.$row['version']; ?>" title="<?php echo $row["name"]; ?>" onselectstart="return false;" fileid="37198419692879875" defaultop="Browse"><?php echo $row["name"]; ?></a>
                <?php } ?>
                <?php if ($row['isdeleted']) echo "</del>"; ?></td>
                <td class="tr"><?php if ($row['isdeleted']) echo "<del class=\"rel gray-2\">"; ?><?php echo $row["length"]; ?><?php if ($row['isdeleted']) echo "</del>"; ?></td>
                  <td class="tr" ><?php if ($row['isdeleted']) echo "<del class=\"rel gray-2\">"; ?><?php echo $row['version']; ?><?php if ($row['isdeleted']) echo "</del>"; ?></td>
                <td class="tr"><?php if ($row['isdeleted']) echo "<del class=\"rel gray-2\">"; ?><?php echo date("Y-m-d H:i:s",$row["createtime"]); ?><?php if ($row['isdeleted']) echo "</del>"; ?></td>
              </tr>
            <?php
                    }
                    else
                    {
            ?>
              <tr id="tr<?php echo $row["id"]; ?>" <?php if ($row['isdeleted']) echo "isdel=\"1\" "; ?> shareid="0" fileid="<?php echo $row["name"]; ?>" filever="1" iscanconvert="" iscanwow="" isimage="" fileext="" filename="<?php echo $row["name"]; ?>" filetype="folder" class="ui-selectee">
                <td class="tc list-chk"><input type="checkbox" filetype="folder" value="<?php echo $row["id"]; ?>"></td>
                <td class="f14 "><?php if ($row['isdeleted']) echo "<del class=\"rel gray-2\">"; ?>
                <b class="ico ico-floder mt10 l"></b>
                <a href="/index.php?dirid=<?php echo $row['dirid']; ?>&path=<?php echo $path; ?>&namepath=<?php echo $namepath.'/'.$row['name']; ?>&showdel=<?php echo $showdel; ?>&groupid=<?php echo $groupid ?>" onselectstart="return false;" fileid="<?php echo $row["id"]; ?>" title="<?php echo $row["name"]; ?>" defaultop="Down"> <?php echo $row["name"]; ?></a>
                <?php if ($row['isdeleted']) echo "</del>"; ?></td>
                <td></td>
                <td></td>
                <td class="tr"><?php if ($row['isdeleted']) echo "<del class=\"rel gray-2\">"; ?><?php echo date("Y-m-d H:i:s",$row["createtime"]); ?><?php if ($row['isdeleted']) echo "</del>"; ?></td>
              </tr>
            <?php
                    }
                }
              }
              else
              {
            ?>
            <tr id="nofilewrap" class="ui-selectee ui-selected">
                <td colspan="4">
                <div class="p15">您当前目录还没有文件哦，您可以 
                <a href="javascript:;" onclick="CommandCenter.handler('Create');" class="btn-127 btn-newdir-127 ti dib mr10">新建文件夹</a> 
                <a href="javascript:;" onclick="CommandCenter.handler('Upload');" class="btn-127 btn-upload-127 ti  dib ">上传新文件</a>
                </div>
                </td>
            </tr>
            <?php
              }
            ?>
          </tbody>
          </table>
        </div>
        <!--filelist E--> 
      </div>
        <!--loglist S-->
        <?php if ($logs != NULL) { ?>
        <div id="content" class="grid-view">
            <table width="710px" border="1" class="items">
              <tr>
                <?php
                if ($groupid != NULL)
                    echo "<th>文件组名</th>";
                ?>
                <th>用户名</th>
                <th>操作</th>
                <th>程序</th>
		<th>客户端</th>
		<th>日期</th>
              </tr>
            <tbody id="filelistwrap">
            <?php
                $odd = true;
                foreach($logs as $row)
                {
                    $odd = !$odd;
            ?>
              <tr class="<?php echo $odd?"odd":"even"; ?>">
                <?php
                if ($groupid != NULL)
                    echo "<td>".$groupname["username"]."</td>";
                ?>
                <td><?php echo $row['username']; ?></td>
                <td><?php echo $row['content']; ?></td>
                <td><?php echo $row['appname']; ?></td>
		<td><?php echo $row['client'];  ?></td>
		<td class="tr"><?php echo $row['ctime']; ?></td>
              </tr>
            <?php
                }
            ?>
            </tbody>
            </table>
        </div>
        <?php } ?>
        <!--loglist E-->
        <!--主体 E--> 
      <!--侧边 S-->
      <div class="rightside" id="aside-menu" style="position: absolute; left: auto; right: 6px; top: 0px; ">
        <div>
          <div class=" file-preview-info">
            <div class="mb10" id="file_preview_wrap">
                <h3>群组信息</h3>
                <table class="tc">
                <?php
                    if ($groupid != NULL)
                    {
                        echo "<tr><td>当前群组：";
                        echo $groupname['username'];
                        echo "</td></tr>";
                        echo "<tr><td><a href=\"index.php\">个人文件</a></td></tr>";
                    }
                    else
                    {
                        foreach($groups as $group)
                        {
                ?>
                <tr><td><a href="/index.php?groupid=<?php echo $group["userid"] ?>"><?php echo $group["username"] ?></a></td></tr>
                <?php
                        }
                    }
                ?>
                </table>
            </div>
            <h3 id="defaultOptext"></h3>
          </div>
          <div id="menuwrap" class="menuwrap mb10"><ul></ul></div>
        </div>

      </div>
      <!--<a href="http://www.kuaipan.cn/index.php?ac=fileview#" class="gotop"><img alt="" src="./files/gotop.jpg"></a>-->
      <!--侧边 E--> 
<div class="cl"></div>
  </div>
  <div class="cnt-bm-bg mid"></div>
</div>
 
<iframe name="openwindow" width="0" height="0" class="dn" src="./templates/blank.html">
</iframe>
<form id="downloadform" class="dn" target="openwindow" method="get" action="#">
<input id="detoken" name=etoken" value="">
<input id="dfileId" name="fileId" value="">
</form>
<div id="piclightBox" style="display:none;">
</div>
<div id="contentmenuwrap" class="dn abs bsc whitebg w-150 cmenu" style="display: none; "><ul></ul></div>
<script>
if (top.location != self.location){  
  top.location = self.location;  
}
var userId="<?php echo $ownerid; ?>",dirId="<?php echo $dirid; ?>",path="<?php echo $currentpath; ?>", userEmail='abcd@gmail.com',userToken='66a609dacdcb4b4a8a12c30f25bd4875-1782891908',ufaServer='http://t1.dfs.kuaipan.cn',Theme='default',appName='';
var cdn_source_path='#',js_path='#',images_path='#',css_path='#';
var conv_server = '#';
var wow_server = '#';
var pubstor_server = '#';
var Site_Url = '#';
var filelink_multenable = 1;
var filelink_domain = '#';
var newuploaddown_enable = 1;
var curview = 'KP';
var popRef = '';
var dirFolderId = "";
<?php
    if ($showdel == 1)
    {
?>
var currIsNoDel = "1";
var isShowDel = "1";
<?php
    }
?>
var defaultPreview = '#';
var defaultOpText =  '';
var ResetTitle = '发布分享链接 - ';
var mergeflag = '';
var outlinkflag = '1';
var outlinkdismsg = '尊敬的用户您好，我们正在对分享链接服务进行功能调整，预计于3月16日恢复服务；在功能调整期间您将不能使用该功能进行分享和下载文件（夹），由此给您带来的不便深表歉意。<br><span class="orange b">(温馨提示：您可以尝试使用&nbsp;“共享给好友”&nbsp;功能分享您的文件)</span>';
</script> 
<script src="/js/jquery-1.4.2.min.js"></script> 
<script src="/js/popwin.js"></script><div><div id="maskLevel" style="position:absolute;top:0;left:0;display:none;text-align:center;z-index:10000;"></div><div id="ym-window" style="z-index: 10001; width: 600px; height: 400px; top: 119.5px; left: 301.5px; position: fixed; display: none; "><div class="ym-tl" id="ym-tl"><div class="ym-tr"><div class="ym-tc" style="cursor:move;"><div class="ym-header-text">上传文件到Draco网盘</div><div class="ym-header-tools"><div class="ymPrompt_min" title="最小化" style="display: none; "><strong>0</strong></div><div class="ymPrompt_max" title="最大化" style="display: none; "><strong>1</strong></div><div class="ymPrompt_close" title="关闭"><strong>r</strong></div></div></div></div></div><div class="ym-ml" id="ym-ml"><div class="ym-mr"><div class="ym-mc"><div class="ym-body " style="position: relative; height: 349px; "><iframe style="position:absolute;width:100%;height:100%;top:0;left:0;opacity:1;filter:alpha(opacity=100)" border="0" frameborder="0" src="./templates/index.html" id="uploadifram2e" name="uploadiframe1"></iframe><div style="position:absolute;width:100%;height:100%;top:0;left:0;opacity:1;filter:alpha(opacity=100);background:#000;opacity:0.1;filter:alpha(opacity=10);display:none"></div></div></div></div></div><div class="ym-ml" id="ym-btnl" style="display: none; "><div class="ym-mr"><div class="ym-btn"></div></div></div><div class="ym-bl" id="ym-bl"><div class="ym-br"><div class="ym-bc"></div></div></div></div></div> 
<script src="/js/common.js"></script> 
<script src="/js/fileviewcore.js"></script> 
<script src="/js/lightbox.min.js"></script> 
<script src="/js/jquery-ui-1.8.16.custom.min.js"></script> 
<script>loadFileCallBack($("#filelistwrap"));</script> 
<script>
$(function(){
popRef = ymPrompt;
var floatToolbar=new WEBKP.floatToolbar();
floatToolbar.init('datawrap','kuaipantoolbar','aside-menu');
//floatToolbar.init('datawrap','kuaipantoolbar','gotop');
$("#piclightBox a").lightBox({
imageLoading: 'http://web.kuaipan.cn/static/css/lightbox/lightbox-ico-loading.gif',
imageBtnClose: 'http://web.kuaipan.cn/static/css/lightbox/lightbox-btn-close.png',
imageBtnPrev: 'http://web.kuaipan.cn/static/css/lightbox/lightbox-btn-prev.gif',
imageBtnNext: 'http://web.kuaipan.cn/static/css/lightbox/lightbox-btn-next.gif',
imageBlank:'http://web.kuaipan.cn/static/css/lightbox/lightbox-blank.gif'});
/*    if(!Cookies.get("mouseSelectAble"))
{
popRef.win({'title':'新功能上线','message':'<div>提示：文档管理支持鼠标框选文件啦。<br /><a class="blue underline" href="http://help.kuaipan.cn/website" target="_blank">使用技巧</a></div>','btn':[["我知道了","ok"]],'handler':function(e){
Cookies.set("mouseSelectAble","1",new Date("11/18/2011"));
}});
}
*/
});
//回调设置上传窗口的标题
function uploadSetTitleCallBack(res)
{
$("#showuploadpress").html(res);
}
</script>
<!--[if IE 6 ]>
<script src="http://web.kuaipan.cn/static/js/file_png_min.js?1.0.0.35""></script>
<script type="text/javascript">try { document.execCommand('BackgroundImageCache', false, true); } catch(e) {}</script>
<![endif]--> 

</body></html>
